/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.himilco.ocana.workflow.core.bo;

import com.himilco.ocana.workflow.core.dao.ServiceProviderDAL;
import com.himilco.ocana.workflow.core.dao.entities.Ticket;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author oussema
 */
@Stateless
public class ServiceProviderBO {

    @PersistenceContext(unitName = "PU_OCANA")
    EntityManager em;
    private ServiceProviderDAL spDAL;

    public List<Ticket> findAllDispatchedTickets() {
        ServiceProviderDAL spDAL = new ServiceProviderDAL(em);
        return spDAL.findAll();
    }

    public void updateTicket(Ticket ticket) {
        ServiceProviderDAL spDAL = new ServiceProviderDAL(em);
        spDAL.update(ticket);
    }
}
